<template>
<div>

  <div>函数修饰符</div>
  <div>{{  msg }}</div>
  <pre>
    “@”，与其说是修饰函数倒不如说是引用、调用它修饰的函数。
    或者用句大白话描述：@: "下面的被我包围了。"


  </pre>

</div>
</template>

<script lang="ts">

function test(target: any,
              propertyKey: string,
              descriptor: TypedPropertyDescriptor<any>
): any {
  console.log('before')
  console.log(target, propertyKey, descriptor)
  console.log('after')
}
import {Vue} from "vue-class-component";

export default class FuncDecorator extends Vue{
  msg = 'sss';
  @test
  init():void {
    console.log('init')
  }
  created(): void {
    this.init()
  }
}
</script>

<style scoped>

</style>
